import { axios } from '@/utils/request'

const api = {
  hospitals: 'http://47.98.161.28:8092/api/hospitals'
}
// 获取所有的医院信息
export function getHospital () {
  return axios({
    url: api.hospitals,
    method: 'GET'
  })
}

// 根据用户 name 获取医院信息
export function getHospitals (name) {
  return axios({
    url: `${api.hospitals}?name=${name}`,
    method: 'GET'
  })
}

// 根据用户 id 获取医院信息
export function getHospitalById (id) {
  return axios({
    url: `${api.hospitals}/${id}`,
    method: 'GET'
  })
}
